<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body>
	<form id="form1" method="post">
        <div style="padding-left:0px;padding-bottom:5px;padding-top: 15px;">
        	<input id="file_upload" name="file_upload" type="file" ></input>
        </div>
        <div style="text-align:center;margin-top: 50px">               
            <a class="mini-button" onclick="onOk" style="width:60px;margin-right:5px;">确定</a>       
            <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>       
        </div>        
    </form>
<script type="text/javascript">
	mini.parse();
	var form = new mini.Form("form1");
	$(function(){
    	setTimeout(function(){
	    	$('#file_upload').uploadify({
	    		'auto':false,
	    		'swf':'scripts/uploadify/uploadify.swf',
	    		'uploader':'customer_import.do;jsessionid=<%=session.getId()%>',
	    		'fileSizeLimit':'5MB',
	    		'fileTypeExts':'*.xls',
	    		'fileTypeDesc':'xls',
	    		'buttonText':'选择文件',
	    		'queueSizeLimit':1,
	    		'onUploadSuccess':function(file, data, response){
	    			data = eval('(' + data + ')');
	    			if(data.success){
		    			window.CloseOwnerWindow("succ");
	    			}else{
	    				mini.alert(data.message);
	    			}
	    		}
	    	});
    	}, 5);
    });
	
    function CloseWindow(action) {            
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();            
    }
    
    function onOk() {
    	$("#file_upload").uploadify('upload', '*');
    }
    
    function onCancel(e) {
    	CloseWindow("cancel");
    }
</script>
</body>
</html>